package org.springblade.modules.admin.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springblade.modules.admin.service.ElevatorService;
import org.springblade.modules.admin.service.IElevatorDetailService;
import org.springblade.modules.admin.vo.ElevatorSearchConditionVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: Sharry
 * @createTime: 2024-09-25 15:42
 * @version: Version-1.0
 */
@RestController
@AllArgsConstructor
@RequestMapping("admin/elevator/search/condition")
@Api(value = "电梯信息", tags = "电梯信息接口")
public class ElevatorSearchController {

	private final ElevatorService elevatorService;

	private final IElevatorDetailService elevatorDetailService;

	/**
	 * 根据搜素条件模糊查询设备注册代码
	 */
	@GetMapping("/private-num")
	@ApiModelProperty("根据搜素条件模糊查询设备注册代码")
	@ApiOperationSupport(order = 40)
	public R<List<ElevatorSearchConditionVO>> getElevatorByPrivateNum(String privateNum) {
		List<ElevatorSearchConditionVO> result = elevatorService.getElevatorByPrivateNum(privateNum);
		return R.data(result);
	}

	/**
	 * 根据搜素条件模糊查询单位内编号
	 */
	@GetMapping("/register-number")
	@ApiModelProperty("根据搜素条件模糊查询单位内编号")
	@ApiOperationSupport(order = 41)
	public R<List<ElevatorSearchConditionVO>> getElevatorByRegisterNumber(String registerNumber) {
		List<ElevatorSearchConditionVO> result = elevatorService.getElevatorByRegisterNumber(registerNumber);
		return R.data(result);
	}

	/**
	 * 根据搜素条件模糊查询使用登记证
	 */
	@GetMapping("/equipment-register-number")
	@ApiModelProperty("根据搜素条件模糊查询使用登记证")
	@ApiOperationSupport(order = 42)
	public R<List<ElevatorSearchConditionVO>> getElevatorByEquipmentRegisterNumber(String equipmentRegisterNumber) {
		List<ElevatorSearchConditionVO> result = elevatorService.getElevatorByEquipmentRegisterNumber(equipmentRegisterNumber);
		return R.data(result);
	}

}
